package com.hr.enums;

/**
 * 自定义异常枚举
 */
public enum ExceptionEnum {

    ROLE_ADD_ERROR(1, "添加角色失败"),
    ROLE_DELETE_ERROR(2, "删除角色失败"),
    ROLE_UPDATE_ERROR(3, "更新角色失败"),
    ROLE_SELECT_ERROR(4, "查询角色失败"),
    ROLE_SELECTLIST_ERROR(5, "查询角色列表失败"),
    ROLE_AUTH_ERROR(6, "角色授权失败"),

    MENU_DELTE_ERROR(11, "删除菜单失败，因为他有下级菜单"),

    ERROR(-1, "系统异常");

    private int code;
    private String msg;

    ExceptionEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    @Override
    public String toString() {
        return "ExceptionEnum{" +
                "code=" + code +
                ", msg='" + msg + '\'' +
                '}';
    }
}
